package base.thread_JUC2.chapter05.demo01;

import java.util.ArrayList;
import java.util.List;

// 生产产品列表
public class ProductListGenerator {
    public List<Product> generate(int size){
        ArrayList<Product> products = new ArrayList<>();
        for (int i = 0; i < size; i++) {
            Product product = new Product();
            product.setName("Product"+i);
            product.setPrice(10);
            products.add(product);
        }
        return products;
    }
}
